#pragma once

#include "stdafx.h"

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#else
#include <sys/time.h>
#endif

class GameTimer
{
public:
	GameTimer();
	~GameTimer();

public:
	void	start();
	void	stop();
	double	getStartTimeInMilliSec();
	double	getElapsedTime();
	double	getElapsedTimeInSec();
	double	getElapsedTimeInMilliSec();
	double	getElapsedTimeInMicroSec();

private:
	double	_startTimeInMicroSec;
	double	_endTimeInMicroSec;
	int		_stopped;

private:
	#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
	LARGE_INTEGER frequency;
	LARGE_INTEGER startCount;
	LARGE_INTEGER endCount;
	#else
	timeval startCount;
	timeval endCount;
	#endif
};